<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript">
function doSave() 
{
	if($("#ttl").val() == '') {
		alert("제목을 입력해 주세요.");
		return false;
	}
	
	if($("#cont").val() == '') {
		alert("내용을 입력해 주세요.");
		return false;
	}
	
	document.forms[0].submit();
	return false;
}
</script>
</head>

<body>
<div class="content_top">
	<p class="path">
		<strong>공지사항</strong>
	</p>
</div>
<h4>서비스 별 공지사항이 보여지며, 등록, 수정 가능합니다.</h4>

<form:form modelAttribute="notice" action="/etc/notice/form" method="post">
<input type="hidden" id="ntcSeq" name="ntcSeq" value="${notice.ntcSeq}">
<div class="tbl_type3">
	<table cellspacing="0" border="1">
	<col width="120">
	<col>
	<col width="120">
	<col>
	<tr>
		<th>서비스</th>
		<td>
			<select id="ntcTypeCd" name="ntcTypeCd">
				<c:forEach items="${noticeTypeList}" var="item">
				<option value="${item.commCd}">[${item.commCd} ${item.commCdNm}]</option>
				</c:forEach>
			</select>
		</td>
		<th>노출여부</th>
		<td>
			<input type="radio" class="rdo" name="delYn" value="Y" checked="checked"><span>노출</span></input>  
			<input type="radio" class="rdo" name="delYn" value="N"><span>숨김</span></input>
		</td>
	</tr>
	<tr>
		<th>제목</th>
		<td colspan="3">
			<input id="ttl" name="ttl" type="text" class="input_txt" style="width: 100%">
		</td>
	</tr>
	<tr>
		<th>내용</th>
		<td colspan="3">
			<textarea id="cont" name="cont" class="input_txt" style="width: 100%; height: 300px;" rows="50" cols="10"></textarea>
		</td>
	</tr>
	</table>
</div>
<br>

<div class="div_right">
	<a href="/etc/notice" class="btn_big"><strong>목록보기</strong></a>
	<a href="javascript:;" class="btn_big" onclick="doSave();"><strong>등록하기</strong></a>
</div>
</form:form>
</body>
</html>